package offer;

import cn.ljj.Tchashu110;

public class erchashu28 {

    erchashu28.Solution solution = new erchashu28().new Solution();


    class Solution {
        public class TreeNode {
            int val;
            Solution.TreeNode left;
            Solution.TreeNode right;
            TreeNode(int x) { val = x; }
        }

        public boolean isSymmetric(TreeNode root) {
            if (root==null)return true;
            return root==null? true : recur(root.left,root.right);
        }
        public boolean recur(TreeNode L,TreeNode R){
            if (L==null&&R==null){
                return true;
            }
            if (L==null||R==null||L.val!=R.val)return false;
            return recur(L.left,R.right)&&recur(L.right,R.left);
        }
    }
}
